package com.sxygsj.android.personnelscreen.receivers;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;

import com.sxygsj.android.personnelscreen.main.MainActivity;

public class BootReceiver extends BroadcastReceiver {
    private static final String ACTION = "android.intent.action.BOOT_COMPLETED";

    private static final String TAG = "BootBroadcast";
    @Override
    public void onReceive(Context context, Intent intent) {
        String action = intent.getAction();
        Log.e(TAG,action);
        if (action.equals(ACTION)) {
            Intent mainActivityIntent = new Intent(context, MainActivity.class);

            mainActivityIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
            context.startActivity(mainActivityIntent);
        }
    }
}